package io.renren.modules.pet.enums;

import lombok.Getter;

@Getter
public enum ApplicantIncomeEnum {
    STATUS_0(0, "小于3千"),
    STATUS_1(1, "3千~6千"),
    STATUS_2(2, "6千~1万"),
    STATUS_3(3, "大于1万");

    private Integer index;
    private String chn;

    ApplicantIncomeEnum(Integer index, String chn) {
        this.index = index;
        this.chn = chn;
    }

    /**
     * 通过索引获取中文表示
     * @param index
     * @return
     */
    public static String getChnByIndex (int index) {
        ApplicantIncomeEnum[] applicantIncomeEnums = ApplicantIncomeEnum.values();
        for (ApplicantIncomeEnum applicantIncomeEnum : applicantIncomeEnums) {
            if (applicantIncomeEnum.index.equals(index)) {
                return applicantIncomeEnum.chn;
            }
        }
        return null;
    }
}
